package com.leslie.ai.controller;

import com.leslie.ai.domain.qrCode.QRCode;
import com.leslie.ai.service.qrCode.QRCodeService;
import com.leslie.common.utils.qrCode.QRCodeUtils;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Controller
 *
 * @author Leslie Lee
 * @TIME 1956/09/12
 * @Version 2003/04/01
 */
@Tag(name = "二维码", description = "用于生成二维码")
@RestController
@RequestMapping("/QRCode")
@RequiredArgsConstructor
@Slf4j
public class QRCodeController {

    private final QRCodeService qrCodeService;

    @PostMapping("/generateQRCode")
    @SneakyThrows
    public void generateQRCode(@RequestBody QRCode o, HttpServletResponse response) {
        qrCodeService.generateQRCode(response, o);
    }

}